home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Tutorial
/
Cookbook
/
02.alert
/
notes
< prev
next >
Wrap
Text File
|
1995-06-12
|
1KB
|
35 lines
Objective:
Learn how to bring up an "Alert Panel"
Learn what a "modal" window is and how it is used.
Learn how to make calls to NeXT supplied "C" library roulines.
Summary:
Complexity:
number of message statements: 0
lines of C code: 3
lines of postscript: 0
Terms: model
Discussion:
A model window is one that will not allow the user to do anything else in the application until
a response is given.
Method:
Create subclass of Object called "MyObject" and instanciate it. Add one action method called
"alert:" Add one button the the main window and then make a connection from the button to
the instance of your object. Do an "unparse from the Class editor and then add the following to
the action method for "alert" in the MyObject file.
int answer;
answer = NXRunAlertPanel("Title", "Message", "Default", "Option One", "Option Two");
printf("Answer = %d\n", answer);
Further Questions:
What happens when you try to use the main "info", "hide" or "quit" menus whild the Alert panel
is up?